#
# @lc app=leetcode.cn id=1002 lang=python
#
# [1002] 查找共用字符
#

# @lc code=start
class Solution(object):
    def commonChars(self, words):
        """
        :type words: List[str]
        :rtype: List[str]
        """
        result=None
        for word in words:
            # 计算每个字符出现的次数
            chars_count=Counter(word)
            if result is None:
                result=chars_count
            else:
                result=result&chars_count
        return list(result.elements())

# @lc code=end

